<?php
require_once dirname(__DIR__) . "/common.php";
use app\cls\tom\Response;
use app\cls\tom\SysResource;
use app\model\Topic;
use app\model\Video;
use app\cls\tom\FFmpeg;
use app\cls\tom\RedisKeyFactory;

//var_dump($readyList);
//$video_uuid=$_REQUEST['video_uuid'];
//$type=$_REQUEST['type'];
//$redis = SysResource::getRedis();
//$k1 = REDIS_PREFIX."test_{$type}_1";
//$k2 = REDIS_PREFIX."test_{$type}_2";
//$k3 = REDIS_PREFIX."test_{$type}_3";
//$k4 = REDIS_PREFIX."test_{$type}_4";
//$k5 = REDIS_PREFIX."test_{$type}_5";
//$k11=$redis->lRange($k1,0,-1);
//$k22=$redis->lRange($k2,0,-1);
//$k33=$redis->lRange($k3,0,-1);
//$k44=$redis->lRange($k4,0,-1);
//$k55=$redis->lRange($k5,0,-1);
//var_dump($k11);
//var_dump($k22);
//var_dump($k33);
//var_dump($k44);
//var_dump($k55);
$redis = SysResource::getRedis();
$token = $_SERVER["HTTP_AUTH_TOKEN"];

$userService = new \app\service\User();
$u_info = $userService->validateToken($token,true);
if($u_info instanceof Response){
    Response::outputSelf($u_info);
}
$userKey = RedisKeyFactory::getUserTokenKey($u_info['uuid']);
$ttl = $redis->ttl($userKey);
/*==================================================================
 * 用户信息 user_id  user_uuid nickname head_image 等等
 *=================================================================*/
Response::output(0,"成功",$u_info,$ttl);
